﻿@model Pro260Website.Models.ListingViewModel<Domain.Entity.Company>
@{
    ViewBag.Title = "Admin -- Companies";
}
<br/>
<h2 class="title @Html.GetColor(Request.Cookies["color"])">Admin -- Companies</h2>

<div id="formBackground">
    <div id="table">
        <table style="text-align: center" class="defaultGrey">
            <tr class="tHeader @Html.GetColor(Request.Cookies["color"])">
                <th>Name</th>
                @*<th>Type</th>*@
                <th></th>
                <th></th>
            </tr>
            @foreach (var c in Model.Items)
            {
                <tr>
                    <td>@Html.ActionLink(c.Name, "EditCompany", new {c.CompanyID})</td>
                    @*<td>@c.Type</td>*@
                    <td>
                        @using (Html.BeginForm("DeleteCompany", "Company"))
                        {
                            @Html.Hidden("CompanyID", c.CompanyID)
                            <input type="submit" value="Delete" class="actionButtons @Html.GetColor(Request.Cookies["color"])" />
                        }
                    </td>
                    <td>@Html.ActionLink("Add News", "AddCompanyNews", new { companyId = c.CompanyID }, new { @class = "actionButtons  " + @Html.GetColor(Request.Cookies["color"]) })</td>
                </tr>
            }
        </table>
       
    <br />
    <br />
    <br />
    <br />
        <div id="titlelessItem">
            <div class="item">
                @Html.ActionLink("Add Company", "CreateCompany", null, new { @class = "actionButtons  " + @Html.GetColor(Request.Cookies["color"]) })
            </div>
        </div>
        <div id="pagerForm" class="pager @Html.GetColor(Request.Cookies["color"])">
                @Html.PageLinks(Model.PagingInfo, i => Url.Action("AdminListings", "Company", new { SearchField = Model.QueryInfo.QueryString, page = i, pageSize = Model.PagingInfo.ItemsPerPage }))
                </div>
    </div>
</div>